﻿/*
 * Created by SharpDevelop.
 * User: Grayson
 * Date: 10/12/2013
 * Time: 11:11 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.IO;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using System.Configuration;
using System.Collections.Specialized;

namespace AORapidSearch
{
	/// <summary>
	/// Description of MainForm.
	/// </summary>
	public partial class MainForm : Form
	{
		public MainForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			//
			
			
			AODB aodb = new AODB();
			String query = "SELECT * from tblItemEffects WHERE value1=206;";
			DataTable effects = aodb.Query(query);
			dataGridView1.DataSource = effects;
			List<int> items  = new List<int>();
			
			foreach(DataRow row in effects.Rows) {
				query = String.Format("SELECT * from tblAO WHERE aoid={0};", row["aoid"].ToString());
				DataTable i = aodb.Query(query);
				DataRow item = i.Rows[0];
				string type = item["type"].ToString();
				if(type.Contains("Armor") || type.Contains("Weapon") || type.Contains("Implant")) {
					items.Add(Convert.ToInt32(item["aoid"]));
				}
				//int type = Convert.ToInt32(row["
				//string aoidN = row["aoid"].ToString();
				//int aoid = Convert.ToInt32(aoidN);
				
			}
			
			//Skills skills = new Skills();
			
			//
			//query = String.Format("SELECT name from tblAO WHERE aoid={0};", aoid);
			//DataTable item = aodb.Query(query);
//			foreach(DataRow r in effects.Rows) {
//				MessageBox.Show(r["value2"].ToString());
//			}
			//MessageBox.Show(item.Rows[0].ToString());
		}

	}
}